{% extends 'base.html' %}
{% load static %}
{% block content %}

    <div class="breadcrumb" style="margin: 0 0 0 200px">
		<a href="#">{{ query }}</a>
		<span>></span>
		<a href="#">搜索结果如下:</a>
	</div>
    <div class="main_wrap clearfix" style="margin: 0 0 0 290px">
        <ul class="goods_type_list clearfix">
            {% for item in page %}
            <li>
                <a href="{% url 'home_page:item_show' item.object.goods_id %}"><img src="{% static 'images/temp/M-001.jpg' %}"></a>
                <h4><a href="{% url 'home_page:item_show' item.object.goods_id %}">{{ item.object.goods_name }}</a></h4>
                <div class="operate">
                    <span class="prize">￥{{ item.object.goods_price }}</span>
                    <a href="#" class="add_goods" title="加入购物车">加入购物车</a>
                </div>
            </li>
            {% endfor %}
        </ul>
        <div class="pagenation">
            {% if page.has_previous %}
            <a href="search?q={{ query }}&page={{ page.previous_page_number }}">上一页</a>
            {% endif %}
            {% for pindex in paginator.page_range %}
                {% if pindex == page.number %}
                    <a href="search?q={{ query }}&page={{ pindex }}" class="active">{{ pindex }}</a>
                {% else %}
                    <a href="search?q={{ query }}&page={{ pindex }}">{{ pindex }}</a>
                {% endif %}
            {% endfor %}
            {% if page.has_next %}
            <a href="search?q={{ query }}&page={{ page.next_page_number }}">下一页></a>
            {% endif %}
        </div>
	</div>

{% endblock %}